from django.urls import path
from rest_framework.routers import DefaultRouter
from rest_framework_jwt.views import obtain_jwt_token


from .views import statistical, users, specs,images

urlpatterns = [
    # 登录路由
    path('authorizations',obtain_jwt_token),
    #用户总量统计
    path('statistical/total_count/',statistical.UserCountView.as_view()),
    # 日增用户统计
    path('statistical/day_count/', statistical.UserDayCountView.as_view()),
    # 日活用户统计
    path('statistical/day_active/', statistical.UserDayActiveView.as_view()),
    # 月增用户统计
    path('statistical/month_count/', statistical.UserMonthCountView.as_view()),
    # 日分类商品访问量增统计
    path('statistical/goods_day_count/', statistical.UserGoodsCountView.as_view()),
    # 获取用户数据
    path('users/', users.UserView.as_view()),
    #获取spu
    path('goods/simple/', specs.SpecsView.as_view({'get':'simple'})),
    #获取sku
    path('skus/simple/', images.ImagesView.as_view({'get': 'simple'})),
]
#商品规格
router = DefaultRouter()
router.register('goods/specs',specs.SpecsView,basename='specs')
print(router.urls)
urlpatterns += router.urls


#图片表路由
router = DefaultRouter()
router.register('skus/images',images.ImagesView,basename='images')
print(router.urls)
urlpatterns += router.urls
